package book;

public class Book {
    private String name;
    private double price;
    private String Author;
    private boolean condition;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getAuthor() {
        return Author;
    }

    public void setAuthor(String author) {
        Author = author;
    }

    public boolean isCondition() {
        return condition;
    }

    public void setCondition(boolean condition) {
        this.condition = condition;
    }

    public Book(String name, double price, String author) {
        this.name = name;
        this.price = price;
        Author = author;
    }

    public String cond(boolean b) {
        if (b) {
            return "已被借出";
        } else {
            return "未被借出";
        }

    }

    @Override
    public String toString() {
        return "Book{" +
                "书名：'" + name + '\'' +
                ", 价格：" + price +
                ", 作者：" + Author + '\'' +
                ", 借阅情况：" + cond(condition) +
                '}';
    }
}
